class Dog{
 public String name;
 public int age;
 public void eat(){
     System.out.println(name+"吃狗粮");
 }
}
public class Test2 {
    public static void main(String[] args) {
        Dog dog=new Dog();
        dog.name="小黑";
        dog.age=1;
        System.out.println(dog.name);
        System.out.println(dog.age);
        dog.eat();
    }
}
